home *** CD-ROM | disk | FTP | other *** search
/ Alles Voor Internet / Tout Pour Internet / alles voor internet.iso / MacInternet™ / Telnet / Terminal 2.2 / Documentation / About Default next >
Text File  |  1992-01-17  |  7KB  |  71 lines

  1.  
  2. About Default 2.3
  3. Copyright © 1991 Lim Unlimited
  4. All Rights Reserved
  5.  
  6. The Default CDEF is a simple aid for Macintosh programmers that draws default button outlines. Default correctly handles buttons of any size and color. Since it works in both your application and your ResEdit dialog and alert templates, Default is useful both for development and for finished products. Default can also draw push buttons, check boxes, and radio buttons using the window’s font. Sample code is also provided for a user item procedure that draws default outlines.
  7.  
  8. ___Instructions___
  9.  
  10. Default is a control definition function that you can copy and paste into your application. The Default CDEF enhances the System file’s standard control definition 0. If the last character of a button’s title is an ‘@’ (an “at” or an “each” symbol), the button is drawn with an outline indicating that it is the default button. The trailing ‘@’ is not drawn with the title.
  11.  
  12. When Color QuickDraw is available, outlines are drawn in the same color as the button’s frame. If the button is inactive, the outline is grayed out. If System 7 or later is being used, the outline is grayed out using the same method as the grayishTextOr mode. If the Default CDEF is in the same file as your application’s DITL resources, ResEdit will display default button outlines drawn by Default. You do not need to write any code to use Default.
  13.  
  14. A dialog’s default button can be changed at any time in your application simply by changing the appropriate button titles. However, you, the programmer, are responsible for making sure there is only one default button. If you are not using a filterProc, Default makes sure that pressing the Return key or Enter key is the same as clicking in the default button. The Dialog Manager will also highlight the default button when the Return key or Enter key is pressed. If you are using your own filterProc, you must perform these tasks.
  15.  
  16. If the last character of a control’s title is an ‘ƒ’, the control is drawn using the window’s current font. Push buttons, check boxes, and radio buttons will look the same as if you used a CNTL resource with the useWFont variation code. This feature is especially useful for Control Panel device dialogs. If you need a default button that uses the window’s font, end the button’s title with ‘ƒ@’.
  17.  
  18. DefaultItem is a user item procedure that draws the same outlines as Default. If you prefer to draw outlines with user items or if you are writing a desk accessory, DefaultItem is for you. The Default CDEF is not compatible with the resource numbering scheme used by desk accessories.
  19.  
  20. ___Compatibility___
  21.  
  22. Default should work on any model of Macintosh with any System version. Default is 32-bit clean. Except for drawing the outline, Default lets the System file’s CDEF 0 do practically everything. Thus, Default’s buttons do anything that normal buttons do.
  23.  
  24. Be warned that Default uses the contrlData field of a ControlRecord (which is okay since it is reserved for CDEFs). If your application does something strange with this field, Default will not work.
  25.  
  26. When you drag or resize a default button in ResEdit, Default might not be able to redraw the default button correctly. This happens because ResEdit doesn’t know about the outline. You can work around this by forcing ResEdit to update the window. With previous versions of Default, you could make Default automatically force ResEdit to update the window. This automatic updating code was removed because ResEdit 2.1 and later update the outline correctly.
  27.  
  28. ___Bugs___
  29.  
  30. The outline will not update if the outline needs updating and the button does not, and UpdtControl or UpdtDialog is being used to update the controls. This problem does not occur with normal modal dialogs and rarely occurs with modeless dialogs. Unfortunately, there isn’t a clean solution for this problem. If you have this problem, you can call Draw1Control for the default button on every update event or simply use DrawControls or DrawDialog instead.
  31.  
  32. If you have a default button and you aren’t using a filterProc, pressing the Return key or Enter key will click in the default button even if the button is hidden. This is a bug in the Dialog Manager. If you have this problem, you must change the default button to a normal button before you call HideDItem or HideControl.
  33.  
  34. If you have a dialog with an edit text item and you want to use a different font style, transfer mode, or font size with the dialog, you must adjust the lineHeight, fontAscent, txFont, txFace, txMode, and txSize fields of the dialog’s textH TextEdit handle as needed. This is another bug in the Dialog Manager. If you just want a different font, SetDAFont works correctly.
  35.  
  36. Please report any other bugs to any of the addresses listed below. Thanks to those programmers who did unusual things with their buttons and reported bugs — they helped make Default more robust.
  37.  
  38. ___History___
  39.  
  40. 1.0 — first release
  41. 1.1 — fixed bug with HideControl and default buttons
  42. 1.2 — updated to support new 32-bit clean CDEF messages
  43. 1.3 — fixed bug with DragControl
  44. 1.4 — fixed bug converting between default buttons and normal buttons;
  45.       improved outlines for unusually sized default buttons
  46. 1.5 — forced ResEdit to refresh default buttons correctly
  47. 2.0 — added automatic Return and Enter support for default buttons;
  48.       added window font feature for push buttons, check boxes, and radio buttons;
  49.       restructured code to reduce size of CDEF
  50. 2.1 — updated to follow Apple’s new way of drawing default outlines
  51. 2.2 — fixed rare bug with Standard File Package;
  52.       removed ResEdit updating code;
  53.       added more optimizations to reduce code size;
  54.       added sample code for default user item procedure
  55. 2.3 — updated to support System 7 grayishTextOr disabling
  56.  
  57. ___Distribution___
  58.  
  59. Default is available free of charge. You may copy and redistribute Default provided that this documentation accompanies any redistributed copies of Default and that the Default CDEF is not modified in any way. Default is owned and copyrighted by Lim Unlimited.
  60.  
  61. You may include Default in any commercial or non-commercial software that you distribute provided that the Default CDEF is not modified in any way and that Lim Unlimited is given a free, fully functional, and fully supported copy of your software.
  62.  
  63. The source code to Default is available on request. You can get a copy via electronic mail or by sending a disk and a stamped self-addressed envelope via postal mail. The source code may not be redistributed without the permission of Lim Unlimited. You may not distribute modified versions of the source code or any software derived from the source code.
  64.  
  65. Lloyd Lim
  66. Lim Unlimited
  67. Postal:  330 W. Iris Avenue, Stockton, CA 95210-3738, U.S.A.
  68. Internet:  lim@cs.sfsu.edu
  69. America Online:  LimUnltd
  70. CompuServe:  72647,660
  71.